{{ $cfg := (site.Params.node.tabs.share) }}

{{ $url := (.Permalink) }}
{{ $title := ((.Title) | plainify) }}
{{ $summary := ((.Summary) | plainify) }}
{{ $tags := ((.Params.tags) | default "") }}
{{ $tags = (delimit ($tags) ",") }}

<div class="node-body">
  <div class="row row-cols-1 row-cols-lg-2 g-3">
    <div class="col">
      <div class="row row-cols-1 g-3">
          {{ if ($cfg.social.enabled) }}
            <div class="col">
              <div class="row row-cols-auto g-2">
                <div class="col">
                  <a class="btn btn-light" href="mailto:?subject={{ ($title) }}&amp;body={{ ($url) }}" data-bs-tooltip data-bs-title='{{ (i18n "email") }}' role="button" rel="noopener noreferrer nofollow">
                    <i class="fas fa-envelope-open-text fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="https://twitter.com/intent/tweet?url={{ ($url) }}&amp;text={{ ($title) }}&amp;hashtags={{ ($tags) }}" data-bs-tooltip data-bs-title='{{ (i18n "social.twitter") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fab fa-twitter fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="https://facebook.com/sharer/sharer.php?u={{ ($url) }}" data-bs-tooltip data-bs-title='{{ (i18n "social.facebook") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fab fa-facebook fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="https://linkedin.com/sharing/share-offsite/?url={{ ($url) }}" data-bs-tooltip data-bs-title='{{ (i18n "social.linkedin") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fab fa-linkedin fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="https://reddit.com/submit?url={{ ($url) }}&amp;title={{ ($title) }}" data-bs-tooltip data-bs-title='{{ (i18n "social.reddit") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fab fa-reddit fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="https://vk.com/share.php?url={{ ($url) }}&amp;title={{ ($title) }}&amp;description={{ ($summary) }}" data-bs-tooltip data-bs-title='{{ (i18n "social.vk") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fab fa-vk fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="https://t.me/share/url?url={{ ($url) }}&amp;text={{ ($title) }}" data-bs-tooltip data-bs-title='{{ (i18n "social.telegram") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fab fa-telegram fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="http://pinterest.com/pin/create/button/?url={{ ($url) }}" data-bs-tooltip data-bs-title='{{ (i18n "social.pinterest") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fab fa-pinterest fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="https://getpocket.com/edit?url={{ ($url) }}&amp;title={{ ($title) }}" target="_blank" data-bs-tooltip data-bs-title='{{ (i18n "social.pocket") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fab fa-get-pocket fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="https://news.ycombinator.com/submitlink?u={{ ($url) }}&amp;t={{ ($title) }}" data-bs-tooltip data-bs-title='{{ (i18n "social.hackernews") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fab fa-hacker-news fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="https://livejournal.com/update.bml?subject={{ ($title) }}&amp;event={{ ($url) }}" data-bs-tooltip data-bs-title='{{ (i18n "social.livejournal") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fas fa-edit fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&amp;st.shareUrl={{ ($url) }}&amp;title={{ ($title) }}" data-bs-tooltip data-bs-title='{{ (i18n "social.ok") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fab fa-odnoklassniki fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="https://blogger.com/blog-this.g?u={{ ($url) }}&amp;n={{ ($title) }}&amp;t={{ ($summary) }}" data-bs-tooltip data-bs-title='{{ (i18n "social.blogger") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fab fa-blogger fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="https://digg.com/submit?url={{ ($url) }}" data-bs-tooltip data-bs-title='{{ (i18n "social.digg") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fab fa-digg fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="https://web.skype.com/share?url={{ ($url) }}&amp;title={{ ($title) }}" data-bs-tooltip data-bs-title='{{ (i18n "social.skype") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fab fa-skype fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="https://api.whatsapp.com/send?text={{ ($url) }}" data-bs-tooltip data-bs-title='{{ (i18n "social.whatsapp") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fab fa-whatsapp fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="https://tumblr.com/widgets/share/tool?canonicalUrl={{ ($url) }}&amp;title={{ ($title) }}&amp;content={{ ($summary) }}&amp;tags={{ ($tags) }}&amp;posttype=link" data-bs-tooltip data-bs-title='{{ (i18n "social.tumblr") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fab fa-tumblr fa-fw"></i>
                  </a>
                </div>
                <div class="col">
                  <a class="btn btn-light btn-social" href="https://wordpress.com/wp-admin/press-this.php?u={{ ($url) }}&amp;t={{ ($title) }}&amp;s={{ ($summary) }}" data-bs-tooltip data-bs-title='{{ (i18n "social.wordpress") }}' role="button" rel="noopener noreferrer nofollow" data-fn="popup">
                    <i class="fab fa-wordpress fa-fw"></i>
                  </a>
                </div>
              </div>
            </div>
          {{ end }}
          {{ if ($cfg.url.enabled) }}
            <div class="col">
              <div class="input-group">
                <span class="input-group-text"><i class="fas fa-link fa-fw"></i></span>
                <input type="text" class="form-control" value="{{ ($url) }}" data-fn="select-all" readonly/>
              </div>
            </div>
          {{ end }}
          {{ if ($cfg.file.enabled) }}
            <div class="col">
                {{ with (.File) }}
                  <div class="input-group">
                    <span class="input-group-text"><i class="fas fa-file fa-fw"></i></span>
                    <input type="text" class="form-control" value="{{ (.Path) }}" data-fn="select-all" readonly/>
                  </div>
                {{ end }}
            </div>
          {{ end }}
      </div>
    </div>
      {{ if ($cfg.qrcode.enabled) }}
        <div class="col">
          <div class="d-flex justify-content-center">
            <div class="d-block img-thumbnail" data-fn="qrcode" data-qr-text="{{ $url }}"></div>
          </div>
        </div>
      {{ end }}
  </div>
</div>
